package com.jd.org.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Department {
    private Long id;
    private String sn;
    private String name;
    private Integer state;

    // 经理
    private Long manager_id;
    private Emp manager;
    // 上级部门
    private Long parent_id;
    private Department parent;
    // 创建一个children对象的集合用来装子部门
    //部门树最后一级没有数据就不显示
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<>();
}
